<template>
  <div id="map"></div>
</template>

<script>
export default {
  name: 'Map',
  mounted: function () {
    this.init()
  },
  created () {
    document.title = '蓝驴附近合作酒店'
  },
  methods: {
    init: function () {
      var myLatlng = new qq.maps.LatLng(30.550290, 104.061010)
      var myOptions = {
        zoom: 12,
        center: myLatlng,
        mapTypeId: qq.maps.MapTypeId.ROADMAP
      }
      var map = new qq.maps.Map(document.getElementById('map'), myOptions)
      // 添加监听事件
      qq.maps.event.addListener(map, 'click', function (event) {
        console.log('您点击的位置为: [' + event.latLng.getLat() + ', ' + event.latLng.getLng() + ']')
      })
    }
  }
}
</script>

<style lang='scss' scoped>
#map{
  width: 100%;
  height: 100%;
}
</style>
